package org.car.world.service.impl;

import java.util.List;

import org.car.world.core.entily.TaskTable;
import org.car.world.core.mapper.TaskTableMapper;
import org.car.world.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;

@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class TaskServiceImpl implements TaskService {

    @Autowired
    TaskTableMapper taskTableMapper;

    @Override
    public int deleteByPrimaryKey(Integer taskId) {
        return taskTableMapper.deleteByPrimaryKey(taskId);
    }

    @Override
    public int insert(TaskTable record) {
        return taskTableMapper.insert(record);
    }

    @Override
    public TaskTable selectByPrimaryKey(Integer taskId) {
        return taskTableMapper.selectByPrimaryKey(taskId);
    }

    @Override
    public List<TaskTable> selectAll() {
        return taskTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(TaskTable record) {
        return taskTableMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<TaskTable> selectLimit(Integer form, Integer size) {
        PageHelper.startPage(form, size);
        return taskTableMapper.selectAll();
    }

    @Override
    public int selectcount() {
        return taskTableMapper.selectcount();
    }

    @Override
    public int updateByPrimaryKeyPic(Integer taskId) {
        return taskTableMapper.updateByPrimaryKeyPic(taskId);
    }

}
